<style type="text/css">
  .modal-body{height:479px;overflow-y: scroll;}
</style>
<div class="col-md-12">
  <div class="nav-tabs-custom">
    <ul class="nav nav-tabs">
      <li class="active"><a href="#activity" data-toggle="tab">接受记录</a></li>
      <li><a href="#timeline" data-toggle="tab">分配记录</a></li>
    </ul>
    <div class="tab-content">
      <div class="active tab-pane" id="activity">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>分配人</th>
                    <th>接受人</th>
                    <th>房卡数量</th>
                    <th>分配时间</th>
                </tr>
            </thead>
            <tbody> 
                @foreach($accepts as $accept)
                    <tr id="{{$accept->id}}">
                        <td>{{$accept->sendName()}}</td>
                        <td>{{$accept->agentName($accept->accept_id)}}</td>
                        <td>{{$accept->gems}}</td>
                        <td>{{$accept->created_at}}</td>
                    </tr>
                @endforeach
            </tbody>
        </table>
      </div>

      <div class="tab-pane" id="timeline">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>分配人</th>
                    <th>接受人</th>
                    <th>房卡数量</th>
                    <th>分配时间</th>
                </tr>
            </thead>
            <tbody> 
                @foreach($sends as $send)
                    <tr id="{{$send->id}}">
                        <td>{{$send->sendName()}}</td>
                        <td>
                          {{$send->userName()}}
                          @if($send->type == 2)
                            (代理) 
                          @elseif($send->type == 3)
                            (玩家)
                          @endif
                        </td>
                        <td>{{$send->gems}}</td>
                        <td>{{$send->created_at}}</td>
                    </tr>
                @endforeach
            </tbody>
        </table>
      </div>
      <!-- /.tab-pane -->

    </div>
    <!-- /.tab-content -->
  </div>
  <!-- /.nav-tabs-custom -->
</div>